<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="keywords" content="">
  <meta name="description" content="">
  <title>修改用户</title>
  <link href="/static/css/bootstrap.min.css" rel="stylesheet"/>
  <link rel="stylesheet" href="/static/include/css/style.css">
  <link href="/static/ajax/libs/select2/select2.min.css" rel="stylesheet"/>
  <link href="/static/ajax/libs/select2/select2-bootstrap.css" rel="stylesheet"/>
  <style type="text/css">
    /* .form-group .ie-placeholder{margin-left: 15px;} */
    .form-group .input-group-dept .ie-placeholder {
      margin-left: -15px;
    }
    .check-box label#roleId-error{
      top: 25px; left: 0;
    }
  </style>
</head>
<body>
<div class="main-content main-user-edit" id="formBox"></div>
<div class="row" id="btnShow">
  <div class="col-sm-offset-5 col-sm-10">
    <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
    <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭</button>
  </div>
</div>

<script id="formTpl" type="text/html">
  <form class="form-horizontal" id="editForm" action="/admin/user">
    <input type="hidden" name="userId" id="userId"  value="{{d.userId || ''}}"/>
    <input type="hidden" name="oper" id="oper" value="{{d.oper || ''}}"/>
    <input type="hidden" name="lockFlag" id="lockFlag"/>
<!--    <input type="hidden" name="role" id="role"/>-->
    <input name="deptId" type="hidden" value="{{d.deptId || ''}}" id="treeId"/>
    <h4 class="form-header h4">基本信息</h4>
    <div class="row">
      <div class="col-sm-6">
        <div class="form-group">
          <label class="col-sm-4 control-label is-required">用户名：</label>
          <div class="col-sm-8">
            <input name="username" autocomplete="off" placeholder="请输入用户名" class="form-control" type="text"
                   maxlength="30" value="{{ d.username || '' }}" required>
          </div>
        </div>
      </div>
      <div class="col-sm-6">
        <div class="form-group">
          <label class="col-sm-4 control-label is-required">归属部门：</label>
          <div class="col-sm-8">
            <div class="input-group input-group-dept">
              <input class="form-control form-control-dept" type="text" placeholder="请选择归属部门" name="deptName" autocomplete="off"
                     onclick="selectDeptTree()" id="treeName" field="deptName" value="{{ d.deptName || '' }}" readonly required>
              <span class="input-group-addon"><i class="fa fa-search"></i></span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-6">
        <div class="form-group">
          <label class="col-sm-4 control-label is-required">手机号码：</label>
          <div class="col-sm-8">
            <input name="phone" id="phone" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11"
                   value="{{ d.phone || '' }}" required>
          </div>
        </div>
      </div>
      <div class="col-sm-6">
        <div class="form-group">
          <label class="col-sm-4 control-label is-required">邮箱：</label>
          <div class="col-sm-8">
            <input id="email" name="email" class="form-control email" type="text" maxlength="70"
                   placeholder="请输入邮箱" value="{{ d.email || '' }}" required>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-6">
        <div class="form-group">
          <label class="col-sm-4 control-label is-required">登录名：</label>
          <div class="col-sm-8">
            {{# if(d.oper == 'add' ){ }}
            <input id="loginname" name="loginname" placeholder="请输入登录账号" class="form-control" type="text"
                   field="loginname" maxlength="30" value="{{ d.loginname || '' }}" required>
            {{# } else { }}
            <input id="loginname" name="loginname" placeholder="请输入登录账号" class="form-control" type="text"
                   field="loginname" maxlength="30" readonly value="{{ d.loginname || '' }}" required>
            {{# } }}
          </div>
        </div>
      </div>
      <div class="col-sm-6">
        <div class="form-group">
          <label class="col-sm-4 control-label">登录密码：</label>
          <div class="col-sm-8">
			  {{# if(d.oper == 'add' ){ }}
			 <input name="password" id="password" autocomplete="new-password" placeholder="请输入登录密码" class="form-control"
			        type="password" maxlength="50">
			  {{# } else { }}
			 <input name="password" id="password" autocomplete="new-password" placeholder="请输入登录密码" class="form-control"
			        type="password" maxlength="50">
			  {{# } }}
            
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-6">
        <div class="form-group">
          <label class="col-sm-4 control-label is-required">用户状态：</label>
          <div class="col-sm-8">
            <label class="toggle-switch switch-solid" id="toggle-switch-normal">
              {{# if(d.lockFlag == '9' ){ }}
              <input type="checkbox" id="status">
              {{# } else { }}
              <input type="checkbox" id="status" checked>
              {{# } }}
              <span></span>
            </label>
            <!--  兼容ie8开关按钮样式 -->
            {{# if(d.lockFlag == '9' ){ }}
            <i id="toggle-switch" class="toggle-switch switch-solid fa fa-toggle-on text-info fa-2x"
               style="display:none;cursor:pointer" data-checked="false"></i>
            {{# } else { }}
            <i id="toggle-switch" class="toggle-switch switch-solid fa fa-toggle-on text-info fa-2x"
               style="display:none;cursor:pointer" data-checked="true"></i>
            {{# } }}
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-12">
        <div class="form-group">
          <label class="col-xs-2 control-label is-required">角色：</label>
          <div class="col-xs-10">
            {{# layui.each(d.roleAll, function(index, role){ }}
            <label class="check-box">
              {{# if(role.flag ){ }}
              <input name="roleId" type="checkbox" value="{{role.roleId}}" text="{{role.roleName}}" checked>{{role.roleName || ''}}
              {{# } else { }}
              <input name="roleId" type="checkbox" value="{{role.roleId}}" text="{{role.roleName}}">{{role.roleName || ''}}
              {{# } }}
            </label>
            {{# }); }}
          </div>
        </div>
      </div>
    </div>
    <h4 class="form-header h4">其他信息</h4>
    <div class="row">
      <div class="col-sm-12">
        <div class="form-group normal-show-error">
          <label class="col-xs-2 control-label">备注：</label>
          <div class="col-xs-10">
            <textarea name="remark" maxlength="200" class="form-control" rows="3">{{ d.remark || '' }}</textarea>
          </div>
        </div>
      </div>
    </div>
  </form>
</script>
<script src="/static/include/js/footer.js"></script>
<script src="/static/ajax/libs/select2/select2.min.js"></script>
<script src="/static/js/algorithm/aes.js"></script>
<script src="/static/js/algorithm/mode-ecb-min.js"></script>
<script src="/static/js/util/AESUtil.js"></script>
<script src="/static/pages/sysadm/user/userEdit.js"></script>
</body>
</html>